<template>
  <div>
    <div class="tupian" @click="$router.push({ path: '/playvideo',query:{id:item.id,video:item.video.url,itemmovname:item.title,itemuser:item.user.avatarurl,itemuname:item.user.nickName} })">
      <img :src="item.video.imgUrl" alt="" />
      <div class="text">
        <p class="wenben">{{ item.title }}</p>
      </div>
      <div class="icon">
        <van-icon name="play-circle-o" />
      </div>
      <div class="time">
        <p>{{ (item.video.dur / 60).toFixed(2) }}</p>
      </div>
      <!-- <img :src="item.video.imgUrl" alt=""> -->
    </div>
    <div class="bottom">
      <div class="user">
        <div class="userimg">
          <img :src="item.user.avatarurl" alt="" />
        </div>
        <div class="username">
          <p>{{ item.user.nickName }}</p>
        </div>
      </div>
      <div class="praise">
        <div class="zuo">
          <div>
            <van-icon name="good-job-o" />
          </div>
          <div>
            {{ item.upCount }}
          </div>
        </div>
        <div class="zhong">
          <div>
            <van-icon name="more-o" />
          </div>
          <div>
            {{ item.shareCount }}
          </div>
        </div>
        <div class="you">
          <div>
            <van-icon name="share-o" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
defineProps({
  item: {
    required: true,
  },
});
</script>

<style lang="scss" scoped>
.tupian {
  width: 100vw;
  height: 210rem;
  margin-top: 15rem;
  position: relative;
  img {
    width: 100%;
    height: 100%;
    display: block;
  }
  .text {
    position: absolute;
    top: 20rem;
    left: 15rem;
    padding-right: 5rem;
    color: #fff;
    font-size: 17rem;
    .wenben{
      overflow: hidden;
      -webkit-line-clamp: 2;
      display: -webkit-box;
      -webkit-box-orient: vertical;
    }
  }
  .icon {
    position: absolute;
    top: 42%;
    left: 38%;
    i {
      font-size: 60rem;
      color: #fff;
    }
  }
  .time {
    position: absolute;
    bottom: 10rem;
    right: 15rem;
    font-size: 12rem;
    color: #fff;
  }
}
.bottom {
  margin: 8rem 0 8rem 15rem;
  display: flex;
  justify-content: space-between;
  .user {
    display: flex;
    .userimg {
      width: 22rem;
      height: 22rem;
      border-radius: 50%;
      img {
        width: 100%;
        height: 100%;
        display: block;
        border-radius: 50%;
      }
    }
    .username {
      margin-left: 5rem;
      display: flex;
      align-items: center;
      margin-left: 8rem;
      font-size: 14rem;
    }
  }
  .praise {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14rem;
    .zuo {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-right: 15rem;
      i {
        font-size: 18rem;
        margin-right: 5rem;
      }
    }
    .zhong {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-right: 15rem;
      i {
        font-size: 18rem;
        margin-right: 5rem;
      }
    }
    .you {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-right: 15rem;
      i {
        font-size: 18rem;
      }
    }
  }
}
</style>
